<%@ page import = "org.wcms.surrounded.Constants" %>

<%
	boolean success = request.getAttribute(Constants.FACEBOOK_SUCCESSFUL_LOGIN) != null && 
		     (Boolean)request.getAttribute(Constants.FACEBOOK_SUCCESSFUL_LOGIN);
		     
     String userName = (String) request.getAttribute("userName");     
     Integer userScore = (Integer) request.getAttribute("userScore");
%>

<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js"></script>
<script type="text/javascript">	
	$(document).ready(function() {		
		if (<%= success %>) {		
			window.opener.loginSucceeded("<%= userName %>", <%= userScore %>);			
			window.close();				
		} else {		
			$("#successParagraph").text("Failed login! Please try again!");
		}
	});
</script>
</head>
<body>
<p id="successParagraph"></p>
</body>
</html>